
CREATE PROCEDURE [dbo].[PayRent] 
	@Game_ID numeric(10,0) = null,
	@Land_ID numeric(10,0) = null,
	@Player_ID numeric(10,0) = null,
	@Owner_Player_ID numeric(10,0) = null
AS
BEGIN 
	DECLARE @Rent int
	--SET @Rent = dbp.fn_CalculateRent()
	SET @Rent = 100
	
	UPDATE 
		[dbo].[PlayerAsset] 
	SET 
		Currency = Currency - @Rent
	WHERE 
		Game_ID = @Game_ID
		and IsActive = 'Y' 
		and Player_ID = @Player_ID
		and AssetType = 'Cash'
		

	UPDATE 
		[dbo].[PlayerAsset] 
	SET 
		Currency = Currency + @Rent
	WHERE 
		Game_ID = @Game_ID
		and IsActive = 'Y'
		and Player_ID = @Owner_Player_ID
		and AssetType = 'Cash'
END
 
-- [dbo].[PayRent]  1,11,3,1,300
